﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.WmsManagement;

namespace Digitalmes.Model.WmsManagement
{
    /// <summary>
    /// 入库
    /// </summary>
	[Table("Inbound")]

    [Display(Name = "_Model.Inbound")]
    public class Inbound : TopBasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._Inbound._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._Inbound._Material")]
        [Comment("物料")]
        public MaterialDoc Material { get; set; }
        [Display(Name = "_Model._Inbound._Material")]
        [Comment("物料")]
        public long? MaterialId { get; set; }
        [Display(Name = "_Model._Inbound._InQty")]
        [Comment("入库数量")]
        [Precision(18,2)]
        [Required(ErrorMessage = "Validate.{0}required")]
        public decimal? InQty { get; set; }
        [Display(Name = "_Model._Inbound._InBatch")]
        [Comment("入库批次")]
        public string InBatch { get; set; }
        [Display(Name = "_Model._Inbound._InboundDate")]
        [Comment("入库时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public DateTime? InboundDate { get; set; }
        [Display(Name = "_Model._Inbound._SupplierId")]
        [Comment("供应商")]
        public long? SupplierId { get; set; }
        [Display(Name = "_Model._Inbound._SupplierName")]
        [Comment("供应商")]
        public string SupplierName { get; set; }
        [Display(Name = "_Model._Inbound._InMode")]
        [Comment("入库方式")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public InOutEnum? InMode { get; set; }
        [Display(Name = "_Model._Inbound._SheetId")]
        [Comment("入库单号")]
        public long? SheetId { get; set; }
        [Display(Name = "_Model._Inbound._SheetNo")]

        public InboundSheet  Sheet { get; set; }    

        [Comment("入库单号")]
        public string SheetNo { get; set; }
        [Display(Name = "_Model._Inbound._InOperator")]
        [Comment("入库操作")]
        public string InOperator { get; set; }
        [Display(Name = "_Model._Inbound._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
